CSharpTest.Net
EnumerateFrom Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Collections Namespace > BTreeList<T> Class : EnumerateFrom Method

start

Glossary Item Box

Inclusivly enumerates from start value to the end of the collection

Syntax

Visual Basic (Declaration) 
Public Function EnumerateFrom( _
   ByVal start As T _
) As IEnumerable(Of T)
C# 
public IEnumerable<T> EnumerateFrom( 
   T start
)

Parameters

start

Example

Library/Library.Test/TestBTreeList.cs

C#Copy Code
BTreeList<int> data = new BTreeList<int>(Comparer);
for (int i = 0; i < 100; i++)
    Assert.IsTrue(data.TryAddItem(i));

Assert.AreEqual(50, new List<int>(data.EnumerateFrom(50)).Count);
Assert.AreEqual(25, new List<int>(data.EnumerateFrom(75)).Count);

for (int i = 0; i < 100; i++)
{
    int first = -1;
    foreach (int kv in data.EnumerateFrom(i))
    {
        first = kv;
        break;
    }
    Assert.AreEqual(i, first);
}
VB.NETCopy Code
Dim data As New BTreeList(Of Integer)(Comparer)
Dim i As Integer = 0
While i < 100
    Assert.IsTrue(data.TryAddItem(i))
    System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While

Assert.AreEqual(50, New List(Of Integer)(data.EnumerateFrom(50)).Count)
Assert.AreEqual(25, New List(Of Integer)(data.EnumerateFrom(75)).Count)

Dim i As Integer = 0
While i < 100
    Dim first As Integer = -1
    For Each kv As Integer In data.EnumerateFrom(i)
        first = kv
        Exit For
    Next
    Assert.AreEqual(i, first)
    System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys